package com.ldd.malphite;

import com.ldd.malphite.entity.Car;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @author Malphite
 * @date 2023/08/25 00:52
 **/

/*
*   1、@SpringBootConfiguration
*       1.1、@Configuration
    2、@EnableAutoConfiguration
        2.1、@AutoConfigurationPackage //将main包下所有的组件注入到IOC容器
                @Import(AutoConfigurationPackages.Registrar.class)
        2.2、@Import(AutoConfigurationImportSelector.class)
*
*
* */




//@SpringBootApplication(scanBasePackages = "")
@SpringBootApplication
@MapperScan(value = "com.ldd.malphite.mapper")
@EnableAspectJAutoProxy
@Slf4j
public class BootApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(BootApplication.class, args);
        String[] beanDefinitionNames = run.getBeanDefinitionNames();
        for (String beanName :
                beanDefinitionNames) {
            log.error("" + beanName);
        }

        Car car = run.getBean(Car.class);
        log.error(""+car);
    }
}
